[BLOCK] blkback: Fix first_sect check.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Oct 2006 09:05:32 +0000 (10:05 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Oct 2006 09:05:32 +0000 (10:05 +0100)
commit7a57f20be7c4a776491c692c319a45256cb1c694
treee0521940bc005305cf951ab4d88fb089a79d2931
parent76da00df1abdb7315d51b84b850670b17cead4bf
[BLOCK] blkback: Fix first_sect check.

The blkback code checks first_sect by computing last_sect - first_sect
+ 1. If this is not positive then the request is
rejected. Unfortunately, the calculation is stored in an unsigned
integer before the check is made so negative values will not be
rejected.

This patch fixes this by explicitly comparing first_sect with
last_sect.

The blktap code is similar but it stores the difference in a signed
integer so it's okay.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c